﻿using Snowing.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace Snowing.Json
{
    public static class JsonResultHelper
    {
        public static JsonResult SetResult<T>(this JsonResult result, T enumValue) where T : struct
        {
            result.Status = (int)(object)enumValue;
            result.Message = DescriptionHelper.GetDescriptionByValue<T>(enumValue);
            return result;
        }
    }
}
